// JavaScript Document
/*Ajax通道*/
function doAjax(type,data){
	loading();
	switch(type){
		case "getPublicLink":
			$.get("../Link/doAjax?type=getPublicLink&data=null",null,function(data){
				$("#div_table").html(data);	diaLoading();
			}).fail(function(){alert("Ajax getPublicLink was failed!");disLoading()});
		break;
		
		case "getPrivateLink":
			$.get("../Link/doAjax?type=getPrivateLink&data=null",null,function(ajaxdata){
				$("#div_table").html(ajaxdata);	disLoading(); delPrivateLink('showOnce',data);
			}).fail(function(){alert("Ajax getPrivateLink was failed!");disLoading()});
		break;
		
		case "delPrivateLink":
			$.get("../Link/doAjax?type=delPrivateLink&data="+data,null,function(data){
				doAjax('getPrivateLink','edit');
			}).fail(function(){alert("Ajax delPrivateLink was failed!");disLoading()});
		break;
		
		case "cenPublicLink":
			$.get("../Link/doAjax?type=cenPublicLink&data="+data,null,function(ajaxdata){
				/*
				if(module == "main"){doAjax('getPublicLink',null)}	
				else if(module.length == 1){doAjax('getTypeLink',module)}
				else{doAjax('getType2Link',module)}
				*/
			}).fail(function(){alert("Ajax cenPublicLink was failed!");disLoading()});
		break;
		
		case "getTypeLink":
			$.get("../Link/doAjax?type=getTypeLink&data="+data,null,function(ajaxdata){
				$("#div_table").html(ajaxdata); disLoading();
			}).fail(function(){alert("Ajax type1Link was failed!");disLoading()});
		break
		
		case "getType2Link":
			$.get("../Link/doAjax?type=getType2Link&data="+data[0],null,function(ajaxdata){
				$("#div_table").html(ajaxdata); disLoading(); $("#"+data[1]).css("background-color","#888").css("color","#FFF");
			}).fail(function(){alert("Ajax type1Link was failed!");disLoading()});
		break;
		
		case "toLinkLog":
			$.get("../Link/doAjax?type=toLinkLog&data="+data,null,function(ajaxdata){
				disLoading();
			}).fail(function(){alert("Ajax toLinkLog was failed!");disLoading()});
		break;
		
		case "feedback":
			$.get("../User/doAjax?type=feedback&data="+data,null,function(ajaxdata){
				alert(ajaxdata); disLoading();
			}).fail(function(){alert("反馈提交失败!请重试!")});
		break;
		
		default:break;
	}
}